﻿using Pvax.Data;

namespace Pvax.Data.Tests
{
    /// <summary>
    /// The optimized version of the <see cref="Person"/>. Suports "new" and "dirty" flags.
    /// </summary>
    /// <remarks>
    /// The class' properties do not raise <c>PropertyChanging</c> events. The tests should give the same
    /// results as with the <see cref="Person"/> class tests.
    /// </remarks>
    public class OptimizedPerson: DbStoreable<long>
    {
        string firstName;

        public string FirstName
        {
            get
            {
                return firstName;
            }
            set
            {
                if(firstName != value)
                {
                    firstName = value;
                    OnPropertyChanged("FirstName");
                }
            }
        }

        string middleName;

        public string MiddleName
        {
            get
            {
                return middleName;
            }
            set
            {
                if(middleName != value)
                {
                    middleName = value;
                    OnPropertyChanged("MiddleName");
                }
            }
        }

        string lastName;

        public string LastName
        {
            get
            {
                return lastName;
            }
            set
            {
                if(lastName != value)
                {
                    lastName = value;
                    OnPropertyChanged("LastName");
                }
            }
        }
    }
}
